package com.wugenqiang.project.inventory.service.impl;

import com.wugenqiang.constant.ParamConstant;
import com.wugenqiang.project.inventory.dao.StorageMapper;
import com.wugenqiang.project.inventory.pojo.Storage;
import com.wugenqiang.project.inventory.service.IStorageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Classname StorageServiceImpl
 * @Description TODO
 * @Date 2019/3/8 16:18
 * @Created by WuGenQiang//fighting!!
 */
@Service
public class StorageServiceImpl implements IStorageService {

    private static final Logger LOGGER = LoggerFactory.getLogger(StorageServiceImpl.class);

    @Resource
    private StorageMapper storageMapper;

    @Override
    public String addGoodsInfo(Storage storage) {
        this.storageMapper.addGoodsInfo(storage);
        return ParamConstant.INSERT_SUCCESS;
    }

    @Override
    public Storage queryGoodsById(Integer id) {
        return this.storageMapper.queryGoodsById(id);
    }

    @Override
    public Storage queryGoodsByIdentifier(String identifier) {
        return this.storageMapper.queryGoodsByIdentifier(identifier);
    }

    @Override
    public Storage queryGoodsByName(String name) {
        return this.storageMapper.queryGoodsByName(name);
    }

    @Override
    public List<Storage> queryGoodsByLikeGoodsName(Storage storage) {
        return this.storageMapper.queryGoodsByLikeGoodsName(storage);
    }

    @Override
    public List<Storage> queryGoodsByLikeGoodsModel(Storage storage) {
        return this.storageMapper.queryGoodsByLikeGoodsModel(storage);
    }

    @Override
    public List<Storage> queryAllGoods() {

        return this.storageMapper.queryAllGoods();
    }

    @Override
    public String updateGoodsInfo(Storage storage) {
        this.storageMapper.updateGoodsInfo(storage);
        return ParamConstant.UPDATE_SUCCESS;
    }
}
